From ea940409a6bbeb6ee1aece1d0f448d5446bbe091 Mon Sep 17 00:00:00 2001 From: Jordi Mallach Date: Sat, 1 Aug 2026 13:36:36 +0200 Subject: [PATCH] Several FTBFS fixes for Hurd systems. Forwarded: no Gbp-Pq: Name hurd.patch --- makefile | 12 ++++++++++++ scripts/genie.lua | 1 + scripts/src/osd/sdl.lua | 3 +++ src/osd/modules/file/posixfile.cpp | 6 ++++++ src/osd/modules/file/posixptty.cpp | 8 ++++++++ src/osd/sdl/sdlprefix.h | 2 +- 6 files changed, 31 insertions(+), 1 deletion(-) diff --git a/makefile b/makefile index c34b7716b..21637dadf 100644 --- a/makefile +++ b/makefile @@ -227,6 +227,8 @@ GENIEOS := bsd else ifeq ($(firstword $(filter GNU/kFreeBSD,$(UNAME))),GNU/kFreeBSD) OS := freebsd GENIEOS := freebsd +else ifeq ($(firstword $(filter GNU,$(UNAME))),GNU) +OS := gnu else ifeq ($(firstword $(filter NetBSD,$(UNAME))),NetBSD) OS := netbsd GENIEOS := freebsd @@ -1306,6 +1308,16 @@ linux: generate $(PROJECTDIR)/$(MAKETYPE)-linux/Makefile $(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-linux config=$(CONFIG) precompile $(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-linux config=$(CONFIG) +.PHONY: gnu_x86 +gnu_x86: generate $(PROJECTDIR)/$(MAKETYPE)-linux/Makefile + $(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-linux config=$(CONFIG)32 precompile + $(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-linux config=$(CONFIG)32 + +.PHONY: gnu +gnu: generate $(PROJECTDIR)/$(MAKETYPE)-linux/Makefile + $(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-linux config=$(CONFIG) precompile + $(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-linux config=$(CONFIG) + #------------------------------------------------- # gmake-linux-clang #------------------------------------------------- diff --git a/scripts/genie.lua b/scripts/genie.lua index fa4a5bb6f..b0e6047a5 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -150,6 +150,7 @@ newoption { { "netbsd", "NetBSD" }, { "openbsd", "OpenBSD" }, { "linux", "Linux" }, + { "gnu", "GNU" }, { "macosx", "OSX" }, { "windows", "Windows" }, { "haiku", "Haiku" }, diff --git a/scripts/src/osd/sdl.lua b/scripts/src/osd/sdl.lua index a53b7fe85..ed0d419be 100644 --- a/scripts/src/osd/sdl.lua +++ b/scripts/src/osd/sdl.lua @@ -221,6 +221,9 @@ if _OPTIONS["targetos"]=="windows" then SDLOS_TARGETOS = "win32" elseif _OPTIONS["targetos"]=="macosx" then SDLOS_TARGETOS = "macosx" +elseif _OPTIONS["targetos"]=="gnu" then + SDL_NETWORK = "taptun" + SYNC_IMPLEMENTATION = "tc" end if BASE_TARGETOS=="unix" then diff --git a/src/osd/modules/file/posixfile.cpp b/src/osd/modules/file/posixfile.cpp index f5dc2e91f..533fa8712 100644 --- a/src/osd/modules/file/posixfile.cpp +++ b/src/osd/modules/file/posixfile.cpp @@ -42,6 +42,12 @@ #define _DARWIN_C_SOURCE #endif +#if defined(__GNU__) +#ifndef PATH_MAX +#define PATH_MAX 1024 +#endif +#endif + // MAME headers #include "posixfile.h" #include "osdcore.h" diff --git a/src/osd/modules/file/posixptty.cpp b/src/osd/modules/file/posixptty.cpp index 6dd35574f..48f1860a2 100644 --- a/src/osd/modules/file/posixptty.cpp +++ b/src/osd/modules/file/posixptty.cpp @@ -27,10 +27,18 @@ #include #elif defined(__linux__) || defined(__EMSCRIPTEN__) #include +#elif defined(__GNU__) +#include +#include #elif defined(__HAIKU__) #include #endif +#if defined(__GNU__) +#ifndef PATH_MAX +#define PATH_MAX 1024 +#endif +#endif namespace { diff --git a/src/osd/sdl/sdlprefix.h b/src/osd/sdl/sdlprefix.h index 13e6c2606..86fe46ec3 100644 --- a/src/osd/sdl/sdlprefix.h +++ b/src/osd/sdl/sdlprefix.h @@ -24,7 +24,7 @@ #ifdef SDLMAME_UNIX -#if defined(__linux__) || defined(__FreeBSD_kernel__) +#if defined(__linux__) || defined(__GNU__) || defined(__FreeBSD_kernel__) #define SDLMAME_LINUX 1 #elif defined(__FreeBSD__) -- 2.30.2